package com.wxl.www.wxl.shiro.controller;

import com.google.inject.internal.cglib.core.$CollectionUtils;
import com.wxl.www.wxl.shiro.entity.SysPermission;
import com.wxl.www.wxl.shiro.entity.SysPlatform;
import com.wxl.www.wxl.shiro.entity.UserInfo;
import com.wxl.www.wxl.shiro.service.SysPermissionService;
import com.wxl.www.wxl.shiro.service.SystemInitService;
import com.wxl.www.wxl.shiro.utils.AOP.LoginUserInfo;
import com.wxl.www.wxl.shiro.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 获取平台系统信息
 */
@Controller
@RequestMapping("/get")
public class SystemInitController {

    @Autowired
    private SystemInitService systemInitService;
    /**
     * 初始化系统
     * @return
     */
    @PostMapping("/system")
    @ResponseBody
    public ResultUtil getSystem(@LoginUserInfo() UserInfo userInfo){
        ResultUtil resultUtil=new ResultUtil();
        List<SysPlatform> byUser = systemInitService.finduiniByUser(userInfo.getId());
        resultUtil.setData(byUser);
        return resultUtil;
    }
}
